package com.kylin.dal.entity.marketing;

import com.kylin.shared.common.entity.BaseEntry;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 秒结配置项持久化实体项
 * @author Damon S.
 */
@Entity
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "t_marketing_board", catalog = "db_kylin_artwork")
public final class MarketingBoardEntry extends BaseEntry implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Long boardId;

    @Column(name = "campaign_id", nullable = false)
    private Long campaignId;

    @Column(name = "commodity_id", nullable = false)
    private Long commodityId;

    @Column private Integer price;
    @Column private Integer inventory;
    @Column private Integer sort;
    @Column private Integer capacity;
    @Column private String cover;

    @Column(length = 64)
    private String title;
    @Column(length = 64)
    private String subtitle;
    
    @Column(name = "buy_limit")
    private Integer buyLimit;

    @Column(name = "compare_price")
    private Integer comparePrice;

    @Column(columnDefinition = "TINYINT", nullable = false)
    private Integer state;

    @Column(columnDefinition = "BIT", nullable = false)
    private Integer removed;

    @Column(name = "created_at", updatable = false, nullable = false)
    private Long createdAt;

    @Column(name = "created_by", updatable = false, nullable = false)
    private Long createdBy;

    @Column(name = "updated_at")
    private Long updatedAt;

    @Column(name = "updated_by")
    private Long updatedBy;

    @Column(name = "removed_at", updatable = false)
    private Long removedAt;

    @Column(name = "removed_by", updatable = false)
    private Long removedBy;
}
